<template>
  <div class="bread" :separator="route.path === '/index' ? '' : '/'">
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/index' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item
        v-for="r in route.matched"
        :key="r.path"
        :to="{ path: route.matched[0].children[0].path }"
      >
        {{ r.meta.title }}</el-breadcrumb-item
      >
    </el-breadcrumb>
  </div>
</template>

<script setup lang="ts">
import { useRoute } from "vue-router";

const route = useRoute();
</script>

<style lang="less" scoped>
.bread {
  padding-bottom: 20px;
}
</style>
